package com.catmiw.stock2013.domain;

import java.util.Date;

import java.text.DecimalFormat;

import com.catmiw.stock2013.util.DateTool;

public class Earnings {
	public Earnings(){}
	
	private String code;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Earnings(Date date){
		this.date=date;
	}
	
	public boolean equals(Object o){
		if (o==null||!(o instanceof Earnings))
			return false;
		
		return date.equals(((Earnings)o).getDate());
	}
	
	private static DecimalFormat df=new DecimalFormat("0.0000");
	private Date date;
	//每股收益
	private double eps;
	//净资产收益率
	private double roe;
	//分配方案
	private String assign;
	//净资产
	private double netAsset;
	//每股净资产
	private double naps;
	//净利润
	private double netProfit;
	//总股数
	private double total;
	
	public double getTotal() {
		return total;
	}

	public double cash;
	
	public double getCash() {
		return cash;
	}
	public void setCash(double cash) {
		this.cash = cash;
	}
	public void setTotal(double total) {
		this.total = total;
	}

	public String toString(){
		return DateTool.dateToString(date, "yyyy-MM-dd")+
			",每股收益:"+df.format(eps)+
			",净资产收益率:"+df.format(roe*100)+"%"+
			",净资产:"+df.format(netAsset)+
			",每股净资产:"+df.format(naps)+
			",净利润:"+df.format(netProfit)+
			",总股本:"+df.format(total)+","+assign;
	}

	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public double getEps() {
		return eps;
	}
	public void setEps(double eps) {
		this.eps = eps;
	}
	public double getRoe() {
		return roe;
	}
	public void setRoe(double roe) {
		this.roe = roe;
	}
	public String getAssign() {
		return assign;
	}
	public void setAssign(String assign) {
		this.assign = assign;
	}
	public double getNetAsset() {
		return netAsset;
	}
	public void setNetAsset(double netAsset) {
		this.netAsset = netAsset;
	}
	public double getNaps() {
		return naps;
	}
	public void setNaps(double naps) {
		this.naps = naps;
	}
	public double getNetProfit() {
		return netProfit;
	}
	public void setNetProfit(double netProfit) {
		this.netProfit = netProfit;
	}
}
